import { ref } from 'vue'
import { defineStore } from 'pinia'

export const loginStore = defineStore('login', () => {
  const token = ref<string>('')
  const newToken = ref<string>('')
  const setToken = (val: string) => {
    token.value = val
  }
  const setNewToken = (val: string) => {
    newToken.value = val
  }

  const resetToken = () => {
    token.value = ''
  }
  const resetNewToken = () => {
    newToken.value = ''
  }

  return { token,newToken, setToken, resetToken,setNewToken,resetNewToken }
}, {
  persist: true
})